#ifndef XBYTEMAIN_H
#define XBYTEMAIN_H

#include <XInitializationFile.h>
#include <XMouse.h>
#include <XButton.h>
#include <XKey.h>
#include <XTexture.h>
#include <XSprite.h>
#include <XFont.h>

#include <OpenGL\glew.h>
#include <OpenGL\freeglut.h>

#ifdef XEXPORTING
#define XEXPORT_DLL __declspec(dllexport)
#else
#define XEXPORT_DLL __declspec(dllimport)
#pragma comment(lib, "XByteMain.lib")
#endif

class XEXPORT_DLL XByteMain
{
protected:
	static XByteMain* Instance;

	int ScreenWidth;
	int ScreenHeight;
	int Fps;
	bool Fullscreen;
	std::string Title;

	XMouse Mouse;
	XButton Button[149];
private:
	void _loadConfig(const char* path);
	static void _close();
	static void _update(int val);
	static void _render();
	static void _keyboard(unsigned char key, int x, int y);
	static void _keyboardUp(unsigned char key, int x, int y);
	static void _special(int key, int x, int y);
	static void _specialUp(int key, int x, int y);
	static void _mouseWheel(int button, int direction, int x, int y);
	static void _mouse(int button, int state, int x, int y);
	static void _motion(int x, int y);
public:
	XByteMain();
	~XByteMain();

	void Initialize(int& argc, char* args[]);
	void Exit();

	virtual void LoadContent() = 0;
	virtual void UnloadContent() = 0;

	virtual void Draw() = 0;
	virtual void Update() = 0;
};

#endif